How to add custom template useful for the Unit Test directly in the Xcode Playgroud
Custom template that allows to write unit tests directly in the Xcode Playgroud with nice error/success messages:
Installation
Manual
Download and unzip Unit Test.xctemplate.zip Copy Unit Test.xctemplate
directory to ~/Library/Developer/Xcode/Templates/File Templates/Playground/
(create the folder if doesn't exits yet)
Bash script
mkdir ./Unit_Test.xctemplate
curl --show-error --location https://github.com/nonameplum/blog/files/7111526/Unit.Test.xctemplate.zip | tar -xf - -C ./Unit_Test.xctemplate
cd ./Unit_Test.xctemplate
mkdir -p ~/Library/Developer/Xcode/Templates/File\ Templates/Playground
cp -R "./Unit Test.xctemplate" ~/Library/Developer/Xcode/Templates/File\ Templates/Playground
Once you restart Xcode you should be able to see the Unit Test template for a new playgroud: